package com.dxb.test.spring_async;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * 线程本地数据测试服务
 *
 * @author DLS
 * @date 2023/02/03
 */
@Service
public class ThreadLocalDataTestService {

    @Async("taskExecutor")
    public void go() {
        try {
            Thread.sleep(1111);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        String s = ThreadLocalDataContext.get();
        System.out.println(s);
    }
}
